package com.ubi.core.framework.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class SafeStringValidator implements ConstraintValidator<SafeString, String> {

    // the white list of safe string for XSS, no HTML related char here

    @Override
    public void initialize(SafeString safeString) {
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return SafeStringValidateUtils.validate(value);
    }
}
